package com.tangfuzhong.service;

import com.tangfuzhong.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class UserService {
	
	@Autowired
	private UserDao userDao;
	
	@Transactional
	public void insertUser(){
		userDao.insert();
		//otherDao.other();xxx
		System.out.println("UserService.insertUser插入完成...");
		//int i = 10/0; //如果抛出异常则回滚事务，保存记录失败
	}

}
